<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">移动版按钮</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="${ctx }">论坛</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a href="${ctx }/topic">帖子列表 <span class="sr-only">(current)</span></a></li>
                <li><a href="${ctx }/userList">会员列表</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">热帖直达 <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="#"><span class="glyphicon glyphicon-star text-danger" ></span> 房产税征缴</a></li>
                        <li><a href="#">如何办理公积金/商业贷款</a></li>
                        <li><a href="#">准备的材料</a></li>
                        <li class="divider"></li>
                        <li><a href="#">商代计算器</a></li>
                        <li class="divider"></li>
                        <li><a href="${ctx}/downLoad">下载客户端</a></li>
                    </ul>
                </li>
            </ul>
            <form class="navbar-form navbar-left" role="search">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="输入查询内容">
                </div>
                <button type="submit" class="btn btn-default">
                    <span class="glyphicon glyphicon-search"></span> 查询
                </button>
            </form>
            <ul class="nav navbar-nav navbar-right">
            	<c:if test="${empty user }">
                <li><a href="${ctx }/register">注册</a></li>
                <li><a href="${ctx }/login">登陆</a></li>
                </c:if>
                <c:if test="${not empty user }">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">用户中心
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu" style="min-width: 130px;">
                        <li><a href="#">设置</a></li>
                        <li><a href="#">个人主页</a></li>
                        <li><a href="#">站内信</a></li>
                    </ul>
                </li>
                <li><a href="${ctx }/logout">登出</a></li>
                </c:if>
                <!--
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Dropdown <span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                    </ul>
                </li>
                -->
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>